public class Test {
}
class Solution {
    public int countDigits(int num) {
        int t = num;
        int ans = 0;
        while(t != 0){
            if(num%(t%10)==0){
                ans++;
            }
            t /= 10;
        }
        return ans;
    }
}
